<h2 class="title">{%if $act eq 'add'%}添加设备{%else%}设备信息{%/if%}</h2>
<form action="index.php?c=zy_mc_type&m={%$act%}&post=1" method=post name=frm enctype="multipart/form-data" onSubmit="return Validator.Validate(this,3)">
<table class="tb_term" width="100%">
<tr>
	<td class="alignright">项目名称</td>
	<td colspan=3>
		<select name="project_id" class="select_edit02 txt-normal"  {%if $is_show == 1%}readonly{%/if%}>
			{%html_options options=$project_arr selected=$project_id%}
		</select>
	</td>
</tr>
<tr>	
	<td class="tr_td_width01 alignright">中文名称</td>
	<td><input type="text" class="input_edit_stand txt-normal" name="mc_cn_name"  value='{%$mc_cn_name%}'  {%if $is_show == 1%}readonly{%/if%} dataType="Require" msg="">&nbsp;&nbsp;&nbsp;&nbsp;{%if $act eq 'add'%}<a href="index.php?c=zy_mc_type&m=browse&investment_no={%$investment_no%}">请选择</a>{%/if%}</td>
	<td class="tr_td_width01 alignright">英文名称</td>
	<td class="tr_td_width04"><input type="text" class="input_edit_stand txt-normal" name="mc_en_name"  value='{%$mc_en_name%}' class="txt-normal" {%if $is_show == 1%}readonly{%/if%}></td>
</tr>
<tr>	
	<td class="alignright">规格型号</td>
	<td><input type="text" class="input_edit_stand txt-normal" name="mc_type_model" value='{%$mc_type_model%}' class="txt-normal" {%if $is_show == 1%}readonly{%/if%}></td>
	<td class="alignright">申请数量</td>
	<td>
		<input type="text" class="input_edit_num txt-normal" name="plan_no" value='{%$plan_no%}' {%if $is_show == 1%}readonly{%/if%} dataType="Number" msg="">
		<label class="label01">单位</label><input type="text" class="input_num_small txt-normal" name="unit" value='{%$unit%}'  {%if $is_show == 1%}readonly{%/if%}>
	</td>
</tr>
<tr>
	<td class="alignright">购置性质</td>
	<td>
	<select name="sell_type_id" class="select_edit txt-normal" {%if $is_show == 1%}readonly{%/if%}>
		{%html_options options=$sell_type_arr selected=$sell_type_id%}
	</select>
	</td>
	<td class="alignright">制造周期</td>
	<td><input type="text" class="input_edit_num txt-normal" name="make_time" value='{%$make_time%}' class="txt-normal"  {%if $is_show == 1%}readonly{%/if%} dataType="Number" msg=""><label class="label01 red">月</label></td>
</tr>
<tr>
	<td class="alignright">制造价格</td>
	<td><input type="text" class="input_edit_num txt-normal" name="make_cost" value='{%$make_cost%}' id="make_cost" onkeyup="change_num();"class="txt-normal" dataType="Require" msg="" {%if $is_show == 1%}readonly{%/if%}><label class="label01">万元</label></td>
	<td class="alignright">管理费用</td>
	<td><input type="text" class="input_edit_num txt-normal" name="manage_cost" id="manage_cost" value='{%$manage_cost%}' class="txt-normal" dataType="Require" msg="" {%if $is_show == 1%}readonly{%/if%} ><label class="label01">万元</label></td>
</tr>
<tr>
	<td class="alignright">增值税费</td>
	<td><input type="text" class="input_edit_num txt-normal" name="vat" id="vat" value='{%$vat%}' class="txt-normal" dataType="Require" msg="" {%if $is_show == 1%}readonly{%/if%}><label class="label01">万元</label></td>
	<td class="alignright">子设备状态</td>
	<td>
		<select name="is_p_mc"  class="select_edit txt-normal" {%if $is_show == 1%}readonly{%/if%}>
			{%html_options options=$is_exist_c_mc selected=$is_p_mc%}
		</select>
		{%if $is_p_mc == 1 && $is_show == 1%}&nbsp;&nbsp;<a href='index.php?c=zy_mc_log&v_mc_id={%$v_mc_id%}'>查看设备</a>{%/if%}	
	</td>
</tr>
<tr>
	<td class="alignright">设备备注</td>
	<td colspan="5"><textarea rows=3 class="textarea_edit  txt-normal" id="mc_info" name="mc_info" {%if $is_show == 1%}readonly{%/if%}>{%$mc_info%}</textarea></td>
</tr>
</table>
{%if $is_show == 1%}
<p class="btn_right">
	<button type="button" class="b-default" onclick="history.go(-1)"><span><em>返回</em></span></button>	
</p>
{%else%}
<p class="btn_right">
	<input type=hidden name='v_mc_id' id='v_mc_id' value='{%$v_mc_id%}'>
	<input type=hidden name='investment_no' id='investment_no' value='{%$investment_no%}'>
	<button type="submit" class="b-default" hidefocus="true"><span><em>{%if $act eq 'add'%}提交{%else%}更新{%/if%}</em></span></button>	
	<button type="button" class="b-default" onclick="history.go(-1)" hidefocus="true"><span><em>返回</em></span></button>	
</p>
{%/if%}
</form>
<script type="text/javascript">
function change_num(){
	var make_cost= $("#make_cost").val();
	//如果造价是数字 则改变 管理费和增值税数值 管理费=造价*2%；增值税=造价*17%
   // var re =  /^[1-9]+[0-9]*]*$/;  //判断正整数 
      if (!isNaN(make_cost))   
     {   
     	manage_cost = make_cost * 0.02;
     	vat = make_cost * 0.17;
		$("#manage_cost").val(manage_cost.toFixed(2));//管理费
		$("#vat").val(vat.toFixed(2));//增值税	   
      }   
	
}
</script>